package com.fg.cloud.manager.service.product.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.fg.cloud.manager.entry.BaseEntity;
import com.fg.cloud.manager.entry.product.ProductSkuImgEntity;
import com.fg.cloud.manager.mapper.BaseMapper;
import com.fg.cloud.manager.mapper.product.ProductSkuImgMapper;
import com.fg.cloud.manager.service.BaseServiceImpl;
import com.fg.cloud.manager.service.product.ProductSkuImgService;

/**
  * Description:SKU图册接口实现
  * @author liushengchao
  * @date 2017年8月4日下午3:35:02
 */
@Service
public class ProductSkuImgServiceImpl extends BaseServiceImpl implements ProductSkuImgService{

	@Autowired
	private ProductSkuImgMapper imgMapper ; 
	@Override
	protected <T extends BaseEntity> BaseMapper getBaseMapper() {
		return imgMapper;
	}
	
	/**
	 * 通过SKUID查询SKU图册列表
	 */
	@Override
	public List<ProductSkuImgEntity> selectBySkuId(Long skuId) {
		return imgMapper.selectBySkuId(skuId);
	}

	/**
	 * 删除SKU图册信息
	 */
	@Override
	@Transactional
	public int deleteBySkuId(Long skuId) {
		return imgMapper.deleteBySkuId(skuId);
	}

	@Override
	public List<String> selectByProductId(Long productId) {
		return imgMapper.selectByProductId(productId);
	}

	@Override
	public int deleteByProductId(Long productId) {
		return imgMapper.deleteByProductId(productId);
	}

}
